package com.shuting.Analysis_PersonClassifyPaper;

public class MasterControl {

	public static void main(String[] args) throws Exception {

		if (args.length != 8) {
			System.out.println("抱歉，您没有输入正确的参数个数(8)！！！");
			System.exit(0);
		}
		
		String personTable = args[0];
		String paperTable = args[1];
		String resultTable = args[2];
		//结果表中的列族: paper or weightPaper
		String countType = args[3];			
		String journalPath = args[4];
		String placePath=args[5];
		String hdfsPath = args[6];
		String deep = args[7];
		
		if(countType.equals("paper")){
			System.out.println("第一阶段开始......");
			PaperInf first = new PaperInf();
			first.start(personTable, paperTable, hdfsPath, placePath, deep);
			
			System.out.println("第一阶段结束，开始第二阶段......");
			Paper_Num second = new Paper_Num();
			second.start(resultTable, hdfsPath);
			System.out.println("第二阶段完成！！！");			
		}
		else if(countType.equals("weightPaper")){
			System.out.println("第一阶段开始......");
			PaperInf first = new PaperInf();
			first.start(personTable, paperTable, hdfsPath, placePath, deep);
			
			System.out.println("统计权威文献（weightPaper）数据，开始第二阶段......");
			WeightPaper_Num second = new WeightPaper_Num();
			second.start(resultTable, hdfsPath,journalPath);
			System.out.println("第二阶段完成！！！");
			
		}else{
			System.out.println("论文统计类型输入错误，请重新输入！！！");
			System.exit(0);
		}
		
	}

}
